

package jetbrains.buildServer.server.rest.errors;

import com.sun.jersey.api.NotFoundException;
import javax.ws.rs.ext.Provider;
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperBase;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

/**
 * User: Yegor Yarko
 * Date: 30.03.2009
 * <p/>
 * This will hopefully report Jersey-originated errors with more details
 */
@Provider
@Component
public class JerseyNotFoundExceptionMapper extends ExceptionMapperBase<NotFoundException> {
  @Override
  public ResponseData getResponseData(@NotNull final com.sun.jersey.api.NotFoundException e) {
    return new ResponseData(e.getResponse().getStatus(), "Please check URL is correct.");
  }
}